<template>
    <view class="tabWrap" :style="{backgroundColor}">
      <div
        v-for="(item, index) in tabList"
        :key="index"
        @click="tabClick(item, index)"
        :class="[theme==='dark'?'tabItem':'',activeIndex===index?'itemActive':'']"
      >
        {{ item.name }}
      </div>
    </view>
</template>

<script>
export default {
  name: "Header",
  props: {
    activeIndex: {
      type: Number,
      default: 0
    },
    backgroundColor: {
      type: String,
      default: '#f5f5f5'
    },
    theme: {
      type: String,
      default:'dark'
    }
  },
  data() {
    return {
      tabList: [
        {
          name: "关注",
          path: "",
        },
        {
          name: "商城",
          path: "",
        },
        {
          name: "推荐",
          path: "",
        },
      ],
    }
  }
}
</script>

<style lang="scss" scoped>
.tabWrap {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 6upx 0upx 30upx 30upx;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}
.tabBody {
  display: flex;
  flex: 1;
  background-color: pink;
  height: 700upx;
}
.tabItem{
  color:#666;
  font-size: 28upx;
}
.itemActive{
  color:#fff;
  font-weight: 600;
  font-size: 32upx;
}
</style>